#include "formlightbutton.h"
#include "ui_formlightbutton.h"

#include "qpainter.h"
#include "qpainterpath.h"
#include "qevent.h"
#include "qtimer.h"
#include "qdebug.h"

FormLightButton::FormLightButton(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::FormLightButton)
{
    ui->setupUi(this);
    ui->lightButton1->setText("button1");
    ui->lightButton2->setText("button2");
    ui->lightButton3->setText("button3");

    timer = new QTimer(this);
    connect(timer, SIGNAL(timeout()), ui->lightButton1, SLOT(updateBgColor()));
    timer->setInterval(500);
    timer->start();
}

FormLightButton::~FormLightButton()
{
    delete ui;
}

void FormLightButton::alarm()
{
    ui->lightButton1->updateBgColor();
    ui->lightButton2->updateBgColor();
    ui->lightButton3->updateBgColor();
}
